unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Menus;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    MainMenu1: TMainMenu;
    Execute1: TMenuItem;
    go1: TMenuItem;
    HelloWorld1: TMenuItem;
    GO2: TMenuItem;
    procedure go1Click(Sender: TObject);
    procedure GO2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.go1Click(Sender: TObject);
var
  M,N:Integer;
  AColValue:string;
  ARowValue:string;
begin
  Memo1.Clear;

  if (InputQuery('','',ARowValue)) and (InputQuery('','',AColValue)) then
  begin
    for M:=1 to StrToInt(ARowValue) do
    begin
      for N:=1 to StrToInt(AColValue) do
      begin
        Memo1.Lines.Add(Format('Value-%d-%d',[M,N]));
      end;
    end;
  end


end;

procedure TForm1.GO2Click(Sender: TObject);
var
  I:Integer;
  Items:array of TMenuItem;
begin
  SetLength(Items,5);
  for I:=0 to 4 do
  begin
    Items[i]:=TMenuItem.Create(HelloWorld1);
    HelloWorld1.Add(Items[i]);
    Items[i].Caption:='Gogo';
  end;
end;

end.
